﻿using UnityEngine;
using static CGF.ScrollView;

namespace CGF
{
    public abstract class ScrollViewDirBase
    {
        protected ScrollView main;
        protected Vector2 endActiveDis;

        public ScrollViewDirBase(ScrollView main)
        {
            this.main = main;
        }

        public void InitData(Vector2 viewportSize)
        {
            this.endActiveDis = viewportSize * 0.2f;
        }

        public abstract void UpdateCellsPos(float x, float y, Cell[] cells);
        public abstract void RefreshSize(Cell[] cells, ref float w, ref float h);
        public abstract (float x, float y) GetInitPos();
        public abstract bool HasFull();
        public abstract void SetRowPos(Row row);
        public abstract bool CanBreak();
        public abstract bool SetXY(Row row, ref float x, ref float y);
        public abstract bool IsCellsExceedsView();
        public abstract void ReduceSpeed();
        public abstract bool ElasticBack(float elastic);
        public abstract void MoveHeadRow();
        public abstract void MoveFollowHeadRow(Row row, Row preRow);
        public abstract void Reuse();
        public abstract float GetTouchPos(Vector2 uiPos);
        public abstract Vector2 EditModeUpdatePos(RectTransform child, int rowIndex, int gridIndex);
    }
}